﻿using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace DbFactory.Base
{
    public interface IBaseTenantRepository<T>
    {

        void add(T m);

        Task addAsync(T m);


        void add(T m, DbTransaction transaction);

        Task addAsync(T m, DbTransaction transaction);


        void update(T m);


        void update(T m, DbTransaction transaction);



        void delete(string id);


        T getOne(string id);


        T getOneWhere(string where);


        IEnumerable<T> getList(string where);


        IEnumerable<T> getList(Expression<Func<T, bool>> expression);


        IEnumerable<T> getList(int page, int pageSize);


        IEnumerable<T> getList(string where, int page, int pageSize);

        IEnumerable<T> getList(Expression<Func<T, bool>> expression, int page, int pageSize);

        int getCount(string where);


        void createTable();


        TableInfo getTableInfo();


        List<string> getTbNameList();


    }

}
